import { HeaderSetting, MenuSetting } from "@/typings/config";
import { defineStore } from "pinia";
import projectSetting from "@/setting/projectSetting";

const { defaultNavTheme, defaultHeaderSetting, defaultMenuSetting } =
  projectSetting;

interface ProjectSettingState {
  navTheme: string;
  headerSetting: HeaderSetting;
  menuSetting: MenuSetting;
}

export const useProjectSettingStore = defineStore({
  id: "app-project-setting",
  state: (): ProjectSettingState => ({
    navTheme: defaultNavTheme,
    headerSetting: defaultHeaderSetting,
    menuSetting: defaultMenuSetting,
  }),
  getters: {
    getHeaderSetting(): object {
      return this.headerSetting;
    },
    getMenuSetting(): object {
      return this.menuSetting;
    },
  },
});
